using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using Unity.VisualScripting;

public class PathNodeText : MonoBehaviour
{
    [SerializeField] SpriteRenderer sprite;

    [SerializeField] TextMeshPro gText;
    [SerializeField] TextMeshPro hText;
    [SerializeField] TextMeshPro fText;


    public void Awake()
    {
        gText = transform.DFS("GCost").GetComponent<TextMeshPro>();
        hText = transform.DFS("HCost").GetComponent<TextMeshPro>();
        fText = transform.DFS("FCost").GetComponent<TextMeshPro>();

        sprite = transform.DFS("Node").GetComponent<SpriteRenderer>();
    }

    public void SetCost(int gCost,int hCost,int fCost)
    {
        gText.SetText(gCost.ToString());
        hText.SetText(hCost.ToString());
        fText.SetText(fCost.ToString());
    }
    
    public void Initialize()
    {
        gText.SetText("");
        hText.SetText("");
        fText.SetText("");
    }

    public void ChangeColor(Color c)
    {
        sprite.color = c;
    }


}
